<template>
	<view class="notice">

		<view class="can-wrapper"   v-for="(item,index) in list" :key="index">
			<view class="can-header">
				<view class="can-title">最新公告</view>
				<view class="can-text">{{item.title}}</view>
			</view>
			<view class="can-time">{{item.create_time}}</view>
			<view class="can-info"  @click="hanldNoticeInfo(item)">
				<view class="info-text">查看详情</view>
				<image src="/static/images/right_icon.png"></image>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			}
		},
		onLoad() {
			this.list = JSON.parse(uni.getStorageSync('noticeList'));
			console.log(this.list);

		},
		methods: {
			hanldNoticeInfo(item) {
				uni.setStorageSync('newsContent', JSON.stringify(item));
				uni.navigateTo({url:`/pages/main/noticeInfo`});
			}
		}
	}
</script>

<style scoped>
	.notice{
		width: 100%;
		min-height: 100%;
		background-color: #FFFFFF;
		padding: 17px;
	}
	.no-text{
		  overflow: hidden;
		      display: -webkit-box;
		      text-overflow: ellipsis;
		      -webkit-line-clamp: 2;  /*要显示的行数*/
		      -webkit-box-orient: vertical;
	}
	.no-left{
		padding-right: 10px;
	}
.notice-wra{
	display: flex;
	flex-direction: row;
	    margin: 10px 0;
}
.no-right image{
	width: 100px;
	height: 75px;
}

.can-wrapper{
	background:rgba(248,248,248,1);
	border-radius:20upx;
	padding: 14px;
	margin-top: 14px;
}
.can{
	width: 100%;
	margin: 15px;
}
.can-info{
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	border-top: 1px solid #E5EBF1;
	padding-top: 15px;
}
.can-info image{
	width: 27px;
	height: 27px;
}
.can-title{
	color: #242424;
	font-size: 15px;
	font-weight: bold;
}
.can-text{
	color: #4D4D4D;
	font-size: 13px;
	padding: 12px 0 8px 0;
}
.can-time{
	color: #B8B9BE;
	text-align: right;
	padding-bottom: 10px;
}
.info-text{
	color: #FF5F49;
	font-size: 14px;
	font-weight: bold;
}
</style>
